Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Command line options helper and usage printer, works well with minimist, inspired by nomnom
Define the allowed options in an array and pass it to 'cliclopts'
var cliclopts = require('cliclopts')
var options = [
{
name: 'verbose',
abbr: 'v',
alias: ['loud'],
boolean: true,
help: 'be verbose'
},
{
name: 'path',
abbr: 'p',
default: './dat.json',
help: 'path to file'
}
]
var cliOpts = cliclopts(options)
options is an array of objects with the following possible keys:
name
primary name of optionabbr
one character alias of the optionalias
other options treated as aliasboolean
if true the option is seen as a boolean flaghelp
usage string for the optiondefault
default value of the optionReturns the usage information as string:
--verbose, -v be verbose
--path, -p path to file (default: "dat.json")
Prints the usage information.
Returns Array of all command names that are specified as boolean.
Returns Object with command names as keys and alias list as value (including abbr)
Returns Object with command names as keys and default values as values.
Returns
{
alias: cliOpts.alias(),
boolean: cliOpts.boolean(),
default: cliOpts.default()
}
minimist
var allowedOptions = [
{
name: 'verbose',
abbr: 'v',
alias: ['cry-at-me'],
boolean: true,
help: 'be verbose'
},
{
name: 'path',
abbr: 'p',
help: 'path to the file'
},
{
name: 'help',
abbr: 'h',
help: 'show help',
boolean: true
}
]
var cliOpts = require('cliclopts')(allowedOptions)
var argv = require('minimist')(process.argv.slice(2), cliOpts.options())
if (argv.help) {
console.log('Usage: command [options]')
cliOpts.print()
process.exit()
}
yourprogram(argv)
FAQs
Command line options helper and usage printer
The npm package cliclopts receives a total of 8,618 weekly downloads. As such, cliclopts popularity was classified as popular.
We found that cliclopts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.